﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Kenly.DBFramework.Gateway
{
    /// <summary>
    /// Represents a attribute that contains metadata of a table or a view,it can be used to marke a class only.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public sealed class TableAttribute : Attribute
    {
        private string _tableName = "";
        private string _sequenceName = "";

        /// <summary>
        /// 
        /// </summary>
        public TableAttribute()
        {
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="tableName"></param>
        public TableAttribute(string tableName)
        {
            _tableName = tableName;
        }

        /// <summary>
        /// Table name or view name.
        /// </summary>
        public string TableName
        {
            get
            {
                return _tableName;
            }
            set
            {
                _tableName = value;
            }
        }

        /// <summary>
        /// It is only used for oracle.
        /// </summary>
        public string IdSequence
        {
            get
            {
                return _sequenceName;
            }
            set
            {
                _sequenceName = value;
            }
        }

    }
}
